home *** CD-ROM | disk | FTP | other *** search
- /* WIDE AREA INFORMATION SERVER SOFTWARE
- No guarantees or restrictions. See the readme file for the full standard
- disclaimer.
- 4.14.90 Harry Morris, morris@think.com
- */
-
- /* Copyright (c) CNIDR (see ../COPYRIGHT) */
-
-
- #ifndef lint
- static char *RCSid = "$Header: /usr/local/ls6/src+data/src/freeWAIS-sf/ir/RCS/ustubs.c,v 1.10 1994/12/13 18:52:45 pfeifer Exp $";
- #endif
-
- /* Change log:
- * $Log: ustubs.c,v $
- * Revision 1.10 1994/12/13 18:52:45 pfeifer
- * chip@chinacat.unicom.com (Chip Rosenthal) patches.
- * Excluding the merge of libinv and libwais
- *
- * Revision 1.9 1994/09/07 13:29:22 pfeifer
- * ctype is now included from cdialect.h after inclusion of string.h.
- * Since ctype.h (the local version defines strcmp and friends, inclusion o
- * of string.h after that caused probems
- *
- * Revision 1.8 1994/09/07 12:43:38 pfeifer
- * added const str2 to memmove definitions
- *
- * Revision 1.7 1994/08/08 07:32:53 pfeifer
- * Moved wais_log_file_name and waislogfile to cutil.[ch]
- *
- * Revision 1.6 1994/08/05 07:12:52 pfeifer
- * Release beta 04
- *
- * Revision 1.4 1994/07/13 07:53:26 pfeifer
- * beta 02
- *
- * Revision 1.3 1994/04/29 23:23:23 pfeifer
- * ifdef'ed memmove/remove for gcc 2.4.3
- * ,
- *
- * Revision 1.2 1994/03/08 21:07:09 pfeifer
- * Patchlevel 04
- *
- * Revision 1.1 1993/02/16 15:05:35 freewais
- * Initial revision
- *
- * Revision 1.4 92/05/06 17:35:13 jonathan
- * Modified some #if's for NeXT and Mach.
- *
- * Revision 1.3 92/03/06 11:08:49 jonathan
- * fixed incompatible return type error in HP version of getwd. Thanks to
- * cshotton@oac.hsc.uth.tmc.edu.
- *
- * Revision 1.2 92/02/12 13:54:29 jonathan
- * Added "$Log" so RCS will put the log message in the header
- *
- *
- */
-
- /*----------------------------------------------------------------------*/
- /* stubs for silly non-ansi c compilers */
- /*----------------------------------------------------------------------*/
-
- #include "ustubs.h"
- #include "cutil.h" /* for substrcmp and NULL */
-
- #ifndef HAVE_GETCWD
- char *getwd(pathname)
- char *pathname;
- {
- return((char*)getcwd(pathname, MAX_FILENAME_LEN));
- }
- #endif
-
- #ifdef SYSV
- #include <prototypes.h> /* may be XENIX dependent! */
- #ifndef HAVE_GETCWD
- char *
- getwd(pathname)
- char *pathname;
- {
- return(getcwd(pathname, MAX_FILENAME_LEN));
- }
- #endif /* HAVE_GETCWD */
- #endif /* def SYSV */
-
- /*----------------------------------------------------------------------*/
-
- #ifndef HAVE_MEMMOVE
- #ifndef ANSI_LIKE /* memmove is an ANSI function not defined by K&R */
- #ifndef hpux /* but HP defines it */
- void*
- memmove(str1,str2,n)
- void* str1;
- const void* str2;
- size_t n;
- {
- bcopy((char*)str2,(char*)str1,(long)n);
- return(str1);
- }
- #endif /* ndef hpux */
-
- #else /* ansi is defined */
-
- #ifdef __GNUC__ /* we are ansi like, are we gcc */
-
- #if !(defined(NeXT) || defined(Mach)) /* and we are not on a next ! */
-
- void*
- memmove(str1,str2,n)
- void* str1;
- const void* str2;
- size_t n;
- {
- bcopy((char*)str2,(char*)str1,(long)n);
- return(str1);
- }
-
- #endif /* not NeXT or Mach */
-
- #endif /* __GNUC__ */
-
- #endif /* else ndef ANSI_LIKE */
- #endif /* HAVE_MEMMOVE */
- /*----------------------------------------------------------------------*/
-
- #ifndef ANSI_LIKE
-
- /* atoi is not defined k&r. copied from the book */
- long atol(s)
- char *s;
- {
- long i, n, sign;
- for(i=0; s[i]==' ' || s[i]== 'n' || s[i]=='t'; i++)
- ; /* skip white space */
- sign = 1;
- if (s[i] == '+' || s[i] == '-')
- sign = (s[i++]=='+') ? 1 : -1;
- for (n=0; s[i] >= '0' && s[i] <= '9'; i++)
- n= 10 * n + s[i] - '0';
- return(sign * n);
- }
-
- /*----------------------------------------------------------------------*/
- #ifndef AUTOCONF
- char *strstr(src,sub)
- char *src;
- char *sub;
- {
- /* this is a poor implementation until the ANSI version catches on */
- char *ptr;
- for(ptr = src; (long)ptr <= (long)src + strlen(src) - strlen(sub); ptr++){
- if(substrcmp(ptr, sub))
- return(ptr);
- }
- return(NULL);
- }
- #endif
- /*----------------------------------------------------------------------*/
- #ifndef HAVE_REMOVE
- int remove(filename)
- char *filename;
- {
- return(unlink(filename));
- }
- #endif /* HAVE_REMOVE */
- /*----------------------------------------------------------------------*/
-
- #endif /* ndef ANSI_LIKE */
-
-
-